<!-- <style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style> -->
<template src="./index.html"></template>
<script>
    export default {
        mixins: [Vue.prototype.$vFN.Mixins.Base, Vue.prototype.$vFN.Mixins.Edit],
        components: {
            SelectImage: async () => Vue.extend(await Vue.prototype.$vFN.Components.Base.SelectImage())
        },
        data() {
            return {
                appWindow: window,
                form: {
                    amount: "",
                    real_name: "",
                    type: "",
                    bank_card: ""
                },
                
                // 页面接口地址
                apiUrl: {
                    create: "store/withdraw/add",
                    update: "store/withdraw/edit",
                    detail: "store/withdraw/detail",
                },
                loading: true,
            };
        },
        methods: {
            // form 提交添加/修改 的参数扩展方法
            mixinEdit_editFormSubmitExtend(data_) { 
                if(JSON.parse(data_.amount) > this.amount) {
                    this.$vFN.Tools.messageError(`最高可提现金额${this.amount}元`);
                    return;
                }
                return data_;
            },
            // 编辑修改的参数扩展方法
            mixinEdit_editDataExtend(data_) {
                // 添加
                if (this.mixinEdit_editType == "add") {
                    
                }
                // 修改
                else if (this.mixinEdit_editType == "update") {

                }
                // 复制
                else if (this.mixinEdit_editType == "copy") {
                    
                }

                return data_;
            },
            

            // 初始化
            async init() {
                this.form.amount = this.amount
                // 初始化数据
                await this.mixinEdit_editBoxInit({
                    model: "form",
                    id: this.id,
                });
            },


        },
        mounted() {
            this.init();
        },
        activated() {},
    };
</script>